<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>潜在客户报表管理</title>
<#include "../common/link.ftl"/>

    <script>
        $(function () {
            $(".btn-chart").click(function () {
                //清空模态框的缓存数据
                $("#chartModal").removeData("bs.modal");
                var url = $(this).data("url");

                $("#chartModal").modal({
                    remote : url+"?"+$("#searchForm").serialize()
                })
            })
        })
    </script>
</head>
<body class="hold-transition skin-blue sidebar-mini">


<div class="wrapper">

<#include "../common/navbar.ftl"/>

    <!--菜单回显-->
<#assign currentMenu="customerReport"/>

<#include "../common/menu.ftl"/>
    <div class="content-wrapper">
        <section class="content-header">
            <h1>潜在客户报表管理</h1>
        </section>
        <section class="content">
            <div class="box">
                <!--高级查询--->
                <div style="margin: 10px;">
                    <!--高级查询--->
                    <form class="form-inline" id="searchForm" action="/customerReport/list" method="post">
                        <input type="hidden" name="currentPage" id="currentPage" value="1">
                        <div class="form-group">
                            <label for="keyword">员工姓名:</label>
                            <input type="text" class="form-control" id="keyword" name="keyword" value="${(qo.keyword)!}"
                                   placeholder="请输入姓名">
                        </div>
                        <div class="form-group">
                            <label for="date">时间段查询:</label>
                            <input type="text" class="form-control" style="width: 100px" id="beginTime" name="beginTime"
                                   onclick="WdatePicker()" value="${((qo.beginTime)?string('yyyy-MM-dd'))!}"> -
                            <input type="text" class="form-control" style="width: 100px" id="endTime" name="endTime"
                                   onclick="WdatePicker()" value="${((qo.endTime)?string('yyyy-MM-dd'))!}">
                        </div>
                        <div class="form-group">
                            <label for="status">分组类型:</label>
                            <select class="form-control" id="groupType" name="groupType">
                                <option value="seller.name">
                                    员工
                                </option>
                                <option value="DATE_FORMAT(c.input_time, '%Y')"
                                >
                                    年
                                </option>
                                <option value="DATE_FORMAT(c.input_time, '%Y-%m')"
                                >
                                    月
                                </option>
                                <option value="DATE_FORMAT(c.input_time, '%Y-%m-%d')"
                                >
                                    日
                                </option>
                            </select>
                            <script>
                                $("#groupType").val("${(qo.groupType)!}")
                            </script>
                            <button id="btn_query" type="button" class="btn btn-primary">
                                <span class="glyphicon glyphicon-search"></span> 查询
                            </button>
                            <button type="button" class="btn btn-info btn-chart"
                                    data-url="/customerReport/reportByBar">
                                <span class="glyphicon glyphicon-stats"></span> 柱状图
                            </button>
                            <button type="button" class="btn btn-warning btn-chart"
                                    data-url="/customerReport/reportByPie">
                                <span class="glyphicon glyphicon-dashboard"></span> 饼状图
                            </button>
                        </div>
                    </form>
                </div>
                <!--编写内容-->
                <div class="box-body table-responsive no-padding ">
                    <table class="table table-hover table-bordered">
                        <tr>
                            <th>分组类型</th>
                            <th>潜在客户新增数</th>
                        </tr>
                    <#list list as entity>
                        <tr>
                            <td>${entity.groupType}</td>
                            <td>${entity.number}</td>
                        </tr>
                    </#list>
                    </table>
                </div>
            </div>
        </section>
    </div>
<#include "../common/footer.ftl"/>
</div>

<div id="chartModal" class="modal fade" tabindex="-1" role="dialog" style="" >
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">

        </div>
    </div>
</div>
</body>
</html>
